package frontend.model.admin;

import backend.model.admin.Occupation;
import frontend.model.base.UIModel;

public class OccupationUIModel implements UIModel<Occupation> {

    private String name;
    private String description;
    private boolean isActive;

    private Occupation occupation;

    public OccupationUIModel() {
        occupation = new Occupation();
        isActive = true;
    }

    public OccupationUIModel(Occupation occupation) {
        this.occupation = occupation;
        populateFieldsFromDBModel();
    }

    @Override
    public void populateFieldsFromDBModel() {
        name = occupation.getName();
        description = occupation.getDescription();
        isActive = occupation.getIsActive();
    }

    @Override
    public void populateDBModelFromFields() {
        occupation.setDescription(description);
        occupation.setName(name);
        occupation.setIsActive(isActive);
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    @Override
    public Occupation getDBModel() {
        return occupation;
    }
}
